package chapterSystem.client.model.entities;

import chapterSystem.client.model.entitiesInt.ChapterEvent;

import java.util.Date;

/**
 * User: Hasp
 * Date: 07.04.12
 * Time: 22:54
 */
public class ChapterEventEntity implements ChapterEvent {
    private int eventId;
    private String title;
    private String description;
    private Date creationDate;

    public ChapterEventEntity() {
    }

    public int hashCode() {
        return eventId;
    }

    public boolean equals(Object o) {
        if (!(o instanceof ChapterEventEntity)) {
            return false;
        }
        return ((ChapterEventEntity) o).eventId == this.eventId;
    }

    public ChapterEventEntity(int eventId, String title, String description, Date creationDate) {
        this.eventId = eventId;
        this.title = title;
        this.description = description;
        this.creationDate = creationDate;
    }

    @Override
    public int getEventId() {
        return eventId;
    }

    @Override
    public String getTitle() {
        return title;
    }

    @Override
    public String getDescription() {
        return description;
    }

    @Override
    public Date getCreationDate() {
        return creationDate;
    }

    @Override
    public String toString() {
        return "ChapterEventEntity{" +
                "eventId=" + eventId +
                ", title='" + title + '\'' +
                ", description='" + description + '\'' +
                ", creationDate=" + creationDate +
                '}';
    }
}
